package Day2025_02_25;

public class LeetCode137 {
    public int singleNumber(int[] nums) {
        int n = nums.length;
        int ret = 0;
        for (int i = 0; i < 32; i++) {
            int sum = 0;
            for (int x :nums) {
                sum += (x >> i) & 1;
            }
            sum %= 3;
            ret |= sum << i;
        }
        return ret;
    }
}
